package com.longcai.service.homegood;

import com.longcai.bean.ApiResult;
import com.longcai.entity.homegood.ClyjGoodsHomepage;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.longcai.util.Page;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RequestBody;

/**
 * <p>
 * 首页商品表 服务类
 * </p>
 *
 * @author LWK
 * @since 2019-03-22
 */
public interface ClyjGoodsHomepageService extends IService<ClyjGoodsHomepage> {

    /**
     * 商品存入solr
     *
     * @return
     */
    ApiResult saveGoodSolr();


    /**
     * 通过类型查询商品
     *
     * @param type
     * @return
     */
    ApiResult getGoodsBytype(String type);

    /**
     * 通过品牌从solr查询商品
     *
     * @param brand
     * @return
     */
    Page<ClyjGoodsHomepage> getGoodsBybrand(String brand);


    /**
     * 从solr查询商品
     *
     * @param goodsid
     * @return
     */
    Map<String,Object> getGoods(String goodsid);


	Map<String, Object> getSpec(JSONObject params);
	/**
     * 分享商品（生成分享二维码）
     * @throws UnsupportedEncodingException 
     * @throws IOException 
     * @throws WriterException 
     * **/
	ApiResult<?> shareGoodsQRcode(@RequestBody JSONObject params) throws UnsupportedEncodingException;

}
